import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/check/api/check/plan/query/page',
    method: 'get',
    params: query
  })
}
export function fetchBroadInfo(query) {
  return request({
    url: '/device/api/assetField/query/list',
    method: 'get',
    params: query
  })
}
// 保存设备信息
export function saveDeviceInfo(query) {
  return request({
    url: '/check/api/check/plan',
    method: 'post',
    data: query
  })
}
// 更新设备信息
export function updateDeviceInfo(query) {
  return request({
    url: '/check/api/check/plan',
    method: 'put',
    data: query
  })
}
// 设备编辑信息查询
export function fetchEditInfo(query) {
  return request({
    url: '/check/api/check/plan/query/' + query,
    method: 'get'
  })
}
// 设备详细信息
export function fetchDetailInfo(query) {
  return request({
    url: '/check/api/check/plan/query/detail/' + query,
    method: 'get'
  })
}
// 导出
export function exportFile(params) {
  console.log(params)
  return request({
    url: '/device/api/deviceAsset/export',
    method: 'post',
    data: params
  })
}
// 批量导入
export function importFile() {
  return request({
    url: '/device/api/deviceAsset/import',
    method: 'post'
    // data: params
  })
}
// 下载批量导入模板

export function downloadTemplete(query) {
  return request({
    url: '/minio/minio/download/excelTemplate',
    method: 'post'
    // params: query
  })
}
// 删除台账
export function deleteDeviceInfo(query) {
  return request({
    url: '/check/api/check/plan/batch',
    method: 'delete',
    data: [query]
  })
}
// 启用
export function useInfo(id) {
  return request({
    url: `/check/api/check/plan/start/${id}`,
    method: 'put'
    // data: query
  })
}
// 停用

export function uselessInfo(id) {
  return request({
    url: `/check/api/check/plan/stop/${id}`,
    method: 'put'
    // data: query
  })
}
// 档案资料
export function fetchHistoryInfo(id) {
  return request({
    url: `/device/api/assetArchive/query/list/${id}`,
    method: 'get'
    // data: query
  })
}
// 通过主键获取该数据下的额外列表

export function fetchItemsInfo(id) {
  return request({
    url: `/check/api/check/plan/${id}/item/query/list`,
    method: 'get'
    // data: query
  })
}
